import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { LinkTypes } from '../dtos/setting.dot';

@Entity('tb_banner', {
  comment: '轮播表',
})
export class Banner {
  @PrimaryGeneratedColumn('increment', { comment: '自增主键', unsigned: true })
  id: number;

  @Column({ comment: '轮播名称' })
  name: string;

  @Column({ comment: '轮播描述', nullable: true })
  description: string;

  @Column({ comment: '轮播图片' })
  image: string;

  @Column({ comment: '链接类型', default: LinkTypes.NONE })
  link: LinkTypes;

  @Column({ comment: '链接地址' })
  url: string;

  @Column({ comment: '排序顺序' })
  sorted: number;

  @Column({ comment: '是否显示', type: 'tinyint', default: true })
  display: boolean;
}
